package cn.wolfcode.shop.cloud.vo;

import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

@Setter
@Getter
public class LoginVO {
    //用JSR303参数校验
//    如果手机号码不满足regexp则表示 手机号码格式不正确；
    @Pattern(regexp = "1[3456789]\\d{9}",message = "手机号码格式不正确")
    private String username;
    @NotEmpty(message = "密码不能为空")
    private String password;

    public LoginVO(String username, String password) {
        this.username = username;
        this.password = password;
    }

    public LoginVO() {
    }
}
